package com.anuode.entity;

import android.content.Intent;
import android.view.KeyEvent;
import android.view.View;

/**
 * Created by xudong on 2015/4/16.
 */
public interface BaseActivityInterface extends View.OnClickListener{
    /**
     *finish this activity
     */
    void finish();

    void init(Object object);

    /**
     * A back Server Listen to NetWork,
     * If NetWorkChage , will  callback this method
     * @param NetWorkType
     */
    void onNetWorkChange(int NetWorkType);

    /**
     * running in a UI thread .
     * it can be called in another thread .
     * @param action
     */
    void runOnUiThread(Runnable action);

    /**
     * refreash this activity
     * @param obj
     */
    void freash(Object obj);

    /**
     * start a activity
     * @param intent
     */
    void startActivity(Intent intent);

    /**
     *Listening to OnKeyDown
     * must Override it
     * @param keyCode
     * @param event
     * @return
     */
    boolean onKeyDown(int keyCode,KeyEvent event);

    /**
     * set this Activity title
     * @param str
     */
    void setTopTitle(String str);
    /**
     * set this Activity title
     * @param id
     */
    void setTopTitle(Integer id);

    void showDialog();
    void dismissDialog();
    public <T extends View> T getViewById(int viewId);
}
